        try {
            $html2pdf = new HTML2PDF('P', 'A4', 'en');
            $html2pdf->setDefaultFont('helvetica');
            $html2pdf->writeHTML($content, false);
 
////            $mailmodel = EmailTemplate::model()->findByPk(9);
////            $mailbody = array('value' => $mailmodel->body, 'type' => 'raw');
////            $arrayFind = array('[user]', '[certificate_name]', '[user_reference1]', '[user_reference2]');
////            $arrayReplace = array($userName, $userBusinessAddress, $userReference1, $userReference2);
////            $mailbody = str_replace($arrayFind, $arrayReplace, $mailbody);
////            $tempid = $mailmodel->template_id;
////            $mailtemp = Template::model()->findByPk($tempid);
////            $subject = $mailmodel->subject;
////            $mailto = $userDetails->b_email;
////            $fileName = 'certificationInvoice.pdf';
////            $attachmentFile = Yii::getPathOfAlias('webroot') . '/user_certifications/certificationInvoice.pdf';
////            $body = $this->renderPartial('/mails/' . $mailtemp->filename, array('mailbody' => $mailbody['value']), true, false);
//            AqSendMail::SendMail($mailto, $subject, $body, $attachmentFile, $fileName, $accountManagerEmail);
//        } catch (HTML2PDF_exception $e) {
//            echo $e;
//            exit;
//        }